package entity

import (
	"core/datetime"
)

type CommDevice struct {
	Id int64 `json:"id,string"                         gorm:"column:id;primaryKey;autoIncrement:false;comment:主键;"`

	Sid string `json:"sid"                         gorm:"column:sid;size:50; unique;comment:设备编号;"`

	CommPortId    int64            `json:"commPortId,string"                         gorm:"column:comm_port_id;comment:协议类型;"`
	CommProxyId   int64            `json:"commProxyId,string"                         gorm:"column:comm_proxy_id;comment:代理程序;"`
	CommDealId    int64            `json:"commDealId,string"                         gorm:"column:comm_deal_id;comment:处理程序;"`
	ClientId      string           `json:"clientId"                         gorm:"column:client_id;size:50;comment:客户端;"`
	PhysicalState string           `json:"physicalState"                         gorm:"column:physical_state;size:10; DEFAULT:'离线';comment:物理在线状态;"`
	LogicState    string           `json:"logicState"                         gorm:"column:logic_state;size:10; DEFAULT:'离线';comment:逻辑在线状态;"`
	LstRevDt      *datetime.MyTime `json:"lstRevDt"                         gorm:"column:lst_rev_dt;comment:最近上传数据时间;"`
	LogicTimeOut  int32            `json:"logicTimeOut"                         gorm:"column:logic_time_out;  DEFAULT:120;comment:逻辑离线时间;"`
}

func (p *CommDevice) TableName() string {
	return "CommDevice"
}
